Repository navigation
feat: honor pi agent config directories for settings - #4
Merged
Merged
Conversation
Store the global pi-python settings.json next to pi's other user extensions instead of ~/.pi/pi-python/settings.json: $PI_CODING_AGENT_DIR/extensions/pi-python/settings.json Resolve the agent dir via pi's own getAgentDir(), which honours PI_CODING_AGENT_DIR and defaults to ~/.pi/agent. Migrate the pre-extensions location once, on load: if the legacy file exists and the new one does not, create the parent directories and move it. The move is best-effort - failure surfaces as a /python-status warning and the legacy file is still read. The project file (<cwd>/.pi/pi-python/settings.json) is unchanged.
The proposed path under $PI_CODING_AGENT_DIR/extensions/pi-python can be the extension itself: local installations commonly put a symlink there. Migrating settings into that directory would write user configuration into the source checkout, dirtying it and risking deletion on package updates. Keep the useful part of the change — honoring pi's agent directory — but store configuration at $PI_CODING_AGENT_DIR/pi-python/settings.json. Use CONFIG_DIR_NAME for the project path as pi's extension API requires, and retain best-effort migration from the historical ~/.pi location. Add cross-runtime tests for path resolution, migration, precedence, and the case where both old and new files exist.
Luminger
force-pushed
the
fix/configdir
branch
from
September 20, 2026 06:09
09ebf2f to
6ec9020
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move pi-python's global settings under pi's configured agent directory instead of the fixed
~/.piroot:The project file similarly follows pi's
CONFIG_DIR_NAME:Existing
~/.pi/pi-python/settings.jsonfiles migrate once when the new location does not exist. Migration is best-effort; on failure the legacy file remains active and/python-statusreports the warning.Review changes
The original proposal used
$PI_CODING_AGENT_DIR/extensions/pi-python/settings.json. That directory can be the extension itself (for example, our local install is a symlink from there to the source checkout), which would write user configuration into source code and expose it to package updates. The reviewed version keeps configuration under the agent root but outside extension code.Validation
New tests cover, under both Node and Bun:
PI_CODING_AGENT_DIRglobal path resolutionCONFIG_DIR_NAMEproject path resolutionThis is intentionally non-breaking: migration requires no user action, so the release remains on the 0.3.x patch line.